<template>
  <div class="card">
    <!-- 卡片 -->
    <h2><i>后台管理注册页面</i></h2>
    <el-form label-width="100px" class="demo-ruleForm">
      <el-form-item label="账号" prop="name">
        <el-input v-model="regdata.username" />
      </el-form-item>
      <el-form-item label="密码" prop="name">
        <el-input v-model="regdata.password" />
      </el-form-item>
      <el-form-item label="邮箱" prop="name">
        <el-input v-model="regdata.email" />
      </el-form-item>
    </el-form>
    <el-button class="button" type="primary" @click="registerFn">确定</el-button>

  </div>
</template>

<script>
import { register } from '@/api/user'
export default {
  data() {
    return {
      regdata: {
        username: '',
        email: '',
        password: ''
      }
    }
  },
  methods: {
    async registerFn() {
      this.regdata = await register(this.regdata)
      //   提示用户
      this.$message.success('注册成功')
    }
  }

}
</script>
<style>
h2{
  text-align: center;
}
.button{
  width: 96%;
margin-left: 60px;
}
.card{
  width: 100%;
  height: 700px;
background-color:#2d3a4b;
}
</style>
